<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8"
	contentType="text/html;charset=utf-8"%>

<title><fmt:message key="branchDetail.title" />
</title>
<content tag="heading">
<fmt:message key="branchDetail.heading" />
</content>


<script language="javascript">
    
         window.parent('treePage').location.href="branchs.html?method=branchDeptTree";   
      
  </script>

<table width="100%" height="76" border="0" cellpadding="0"
	cellspacing="0">
	<tr>
		<td align="left" valign="top">

			<c:if test="${param.from == 'tree' }">

				<table width="100%" border="0" align="center" cellpadding="0"
					cellspacing="0">
					<tr>
						<td height="25" bgcolor="#5F9CD4" class="font01">
							&nbsp;&nbsp;&nbsp;&nbsp;系统&gt;&gt; 机构部门&gt;&gt;机构信息
						</td>
					</tr>
					<tr>
						<td height="8"></td>
					</tr>
				</table>
			</c:if>

			<html:form action="saveBranch" method="post" styleId="branchForm"
				onsubmit="return validateBranchForm(this)">

				<html:hidden property="branchId" />

				<!--- BEGIN--->
				<table width="99%" border="0" align="center" cellpadding="1"
					cellspacing="1" bgcolor="#CDCDCD">
					<tr>
						<td height="27" background="img/m-bt-bg01.gif" bgcolor="#FFFFFF"
							style="background-repeat:no-repeat;background-position:right">
							<table width="99%" border="0" align="center" cellpadding="0"
								cellspacing="0">
								<tr>
									<td width="2%">
										<img src="img/dian-1.gif" width="6" height="6" />
									</td>
									<td width="48%" class="btn02">
										机构信息
									</td>
									<td width="50%">
										&nbsp;
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td bgcolor="#F8F8F8">
							<table width="100%" border="1" cellspacing="0" cellpadding="1"
								bordercolor="ffffff" bordercolordark="#ffffff"
								bordercolorlight="B9B9B9">
								<tr align="center">
									<td width="133" height="28" bgcolor="#EFEFEF">
										<carsite:label styleClass="desc" key="branchForm.branchName" />
									</td>
									<td width="310" height="28">
										<html:errors property="branchName" />
										<html:text property="branchName" styleId="branchName"
											styleClass="text medium" />
									</td>
									<td width="156" height="28" bgcolor="#EFEFEF">
										<carsite:label styleClass="desc" key="branchForm.telNo" />
									</td>
									<td width="625" height="28">
										<html:errors property="telNo" />
										<html:text property="telNo" styleId="telNo"
											styleClass="text medium" />
									</td>
								</tr>
								<tr align="center">
									<td height="28" bgcolor="#EFEFEF">
										<carsite:label styleClass="desc" key="branchForm.address" />
									</td>
									<td height="28">
										<html:errors property="address" />
										<html:text property="address" styleId="address"
											styleClass="text medium" />
									</td>
									<td height="28" bgcolor="#EFEFEF"></td>
									<td height="28">

									</td>




								</tr>
								<tr align="center">
									<td height="28" bgcolor="#EFEFEF">
										<carsite:label styleClass="desc" key="branchForm.parent" />
									</td>
									<td height="28">

										<html:text property="parentName" styleClass="inputstyle"
											onclick="javascript:onShow(this,'parentId','branchDiv')"
											size="27" maxlength="27" />
										<html:hidden property="parentId" />
										<jsp:include page="branchDiv.jsp">
											<jsp:param name="isParent" value="true" />
										</jsp:include>

									</td>
									<td height="28" bgcolor="#EFEFEF"></td>
									<td height="28">


									</td>
								</tr>
							</table>
							<table width="100%" border="1" align="center" cellpadding="0"
								cellspacing="0" bordercolor="ffffff" bordercolorlight="B9B9B9"
								bordercolordark="#ffffff">
								<tr bgcolor="#99CCCC">
									<td width="25%" height="28" align="center" bgcolor="#EFEFEF">
										&nbsp;
									</td>
									<td width="34%" height="28" align="center" nowrap
										bgcolor="#EFEFEF">

										<html:submit property="method.save" onclick="bCancel=false">
											<fmt:message key="button.save" />
										</html:submit>



										<c:if test="${param.from != 'tree' }">
											<c:if test="${branchForm.branchId != null}">

												<html:submit styleClass="inputstyle"
													property="method.delete"
													onclick="bCancel=true; return confirmDelete('Branch')">
													<fmt:message key="button.delete" />
												</html:submit>
										          &nbsp;
												 
												  <input type="button" name="button" styleClass="inputstyle"
													value="增加部门"
													onclick="window.location.href='editDepartment.html?branchId=<c:out value="${branchForm.branchId}"/>'">  
												  &nbsp;
												 <input type="button" name="button" styleClass="inputstyle"
													value="增加下级机构"
													onclick="window.location.href='editBranch.html?parentId=<c:out value="${branchForm.branchId}"/>'">
											</c:if>

										</c:if>


									</td>
									<td width="41%" height="28" bgcolor="#EFEFEF">
										&nbsp;
									</td>
								</tr>
							</table>

						</td>
					</tr>
				</table>

				<!---END--->


			</html:form>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>
						&nbsp;
					</td>
				</tr>
			</table>


		</td>
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td height="5"></td>
	</tr>
</table>


<script type="text/javascript">
    Form.focusFirstElement($("branchForm"));
</script>

<html:javascript formName="branchForm" cdata="false"
	dynamicJavascript="true" staticJavascript="false" />
<script type="text/javascript"
	src="<html:rewrite page="/scripts/validator.jsp"/>"></script>
